import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';

@Component({
    selector: 'ou-org-tabset',
    templateUrl: './ou-org-tabset.component.html',
    styleUrls: ['./ou-org-tabset.component.less']
})
export class OuOrgTabsetComponent implements OnInit {

    @Output() dataChange = new EventEmitter<string>();

    @Output() itemClickEvent = new EventEmitter<any>();

    constructor() {
    }

    _subOrgBaseParam: any;

    get subOrgBaseParam() {
        return this._subOrgBaseParam;
    }

    set subOrgBaseParam(_subOrgBaseParam: any) {
        this._subOrgBaseParam = _subOrgBaseParam;
    }

    _orgId: string;

    get orgId() {
        return this._orgId;
    }

    @Input()
    set orgId(_orgId: string) {
        this._orgId = _orgId;
        this.subOrgBaseParam = {orgType: 'ORG', parentOrgId: this.orgId};
    }

    ngOnInit() {
    }

    doDataChange(type) {
        this.dataChange.emit(type);
    }

    itemClick(key) {
        this.itemClickEvent.emit(key);
    }

}
